home *** CD-ROM | disk | FTP | other *** search
- class Soldado extends Sprite
- {
- var nivel;
- var EXP;
- var lider;
- var status;
- var itens;
- var magias;
- var flecha;
- var deslocamento;
- var mododesejado;
- var nome;
- var classe;
- var tropa;
- var modo;
- var custo;
- var alcance;
- var PV;
- var PM;
- var maxPV;
- var maxPM;
- var ATQ;
- var DEF;
- var AGL;
- var INT;
- var MRL;
- var dano;
- var defesa;
- function Soldado()
- {
- super();
- this.nivel = 1;
- this.EXP = 0;
- this.lider = false;
- this.status = true;
- this.itens = new Array();
- this.magias = new Array();
- this.flecha = 14;
- this.deslocamento = 0;
- this.mododesejado = 0;
- }
- function isLeader()
- {
- return this.lider;
- }
- function setNome(nome)
- {
- this.nome = nome;
- }
- function setClasse(classe)
- {
- this.classe = classe;
- }
- function setTropa(tropa)
- {
- this.tropa = tropa;
- }
- function setModo(modo)
- {
- this.modo = modo;
- }
- function setCusto(c)
- {
- this.custo = c;
- }
- function setAlcance(al)
- {
- this.alcance = al;
- }
- function setNivel(nivel)
- {
- this.nivel = nivel;
- }
- function setEXP(EXP)
- {
- this.EXP = EXP;
- }
- function setPV(pv)
- {
- this.PV = pv >= 0 ? pv : 0;
- }
- function setPM(pm)
- {
- this.PM = pm;
- }
- function setMaxPV(pv)
- {
- this.maxPV = pv;
- }
- function setMaxPM(pm)
- {
- this.maxPM = pm;
- }
- function setATQ(atq)
- {
- this.ATQ = atq;
- }
- function setDEF(def)
- {
- this.DEF = def;
- }
- function setAGL(agl)
- {
- this.AGL = agl;
- }
- function setINT(int)
- {
- this.INT = int;
- }
- function setMRL(mrl)
- {
- this.MRL = mrl;
- }
- function setDano(dano)
- {
- this.dano = dano;
- }
- function setDefesa(def)
- {
- this.defesa = def;
- }
- function getNome()
- {
- return this.nome;
- }
- function getClasse()
- {
- return this.classe;
- }
- function getTropa()
- {
- return this.tropa;
- }
- function getModo()
- {
- return this.modo;
- }
- function getCusto()
- {
- return this.custo;
- }
- function getAlcance()
- {
- return this.alcance;
- }
- function getNivel()
- {
- return this.nivel;
- }
- function getEXP()
- {
- return this.EXP;
- }
- function getMaxPV()
- {
- return this.maxPV;
- }
- function getMaxPM()
- {
- return this.maxPM;
- }
- function getPV()
- {
- return this.PV;
- }
- function getPM()
- {
- return this.PM;
- }
- function getATQ()
- {
- return this.ATQ;
- }
- function getDEF()
- {
- return this.DEF;
- }
- function getAGL()
- {
- return this.AGL;
- }
- function getINT()
- {
- return this.INT;
- }
- function getMRL()
- {
- return this.MRL;
- }
- function getDano()
- {
- return this.dano;
- }
- function getDefesa()
- {
- return this.defesa;
- }
- function addNivel(n)
- {
- this.nivel += n;
- this.maxPV += 30 * n;
- this.maxPM += this.maxPM <= 0 ? 0 : 10 * n;
- this.PV = this.maxPV;
- this.PM = this.maxPM;
- this.ATQ += 3 * n;
- this.DEF += 2 * n;
- this.AGL += 1 * n;
- this.INT += this.INT <= 0 ? 0 : 2 * n;
- this.MRL += n;
- this.custo *= n + 1;
- }
- function addItem(x)
- {
- var _loc3_ = 1;
- this.itens.push(_root.createItem(x));
- this.itens.sortOn(["valor","tipo"],Array.RETURNINDEXEDARRAY);
- while(_loc3_ < 6)
- {
- if(this.itens[_loc3_ - 1])
- {
- if(this.itens[_loc3_ - 1].isEquiped())
- {
- _root["item" + _loc3_].equip.gotoAndStop(2);
- }
- else
- {
- _root["item" + _loc3_].equip.gotoAndStop(1);
- }
- _root["item" + _loc3_].item.gotoAndStop(this.itens[_loc3_ - 1].getCod() + 2);
- _root["item" + _loc3_].item.useHandCursor = true;
- }
- else
- {
- _root["item" + _loc3_].item.useHandCursor = false;
- _root["item" + _loc3_].item.gotoAndStop(1);
- _root["item" + _loc3_].equip.gotoAndStop(1);
- }
- _loc3_ = _loc3_ + 1;
- }
- }
- function removeItem(x)
- {
- var _loc3_ = 1;
- this.itens.splice(x,1);
- this.itens.sortOn(["valor","tipo"],Array.RETURNINDEXEDARRAY);
- while(_loc3_ < 6)
- {
- if(this.itens[_loc3_ - 1])
- {
- if(this.itens[_loc3_ - 1].isEquiped())
- {
- _root["item" + _loc3_].equip.gotoAndStop(2);
- }
- else
- {
- _root["item" + _loc3_].equip.gotoAndStop(1);
- }
- _root["item" + _loc3_].item.gotoAndStop(this.itens[_loc3_ - 1].getCod() + 2);
- _root["item" + _loc3_].item.useHandCursor = true;
- }
- else
- {
- _root["item" + _loc3_].item.useHandCursor = false;
- _root["item" + _loc3_].item.gotoAndStop(1);
- _root["item" + _loc3_].equip.gotoAndStop(1);
- }
- _loc3_ = _loc3_ + 1;
- }
- }
- }
-